﻿using System.Data.Entity.ModelConfiguration;

namespace CS795.TravelAgency.Hotel.Domain.Entities.Configurations
{
    public class PaymentConfiguration : EntityTypeConfiguration<Payment>
    {
        public PaymentConfiguration()
        {
            HasKey(p => p.Id);
            Property(p => p.Name).HasMaxLength(100).IsRequired();
            Property(p => p.AddressLine1).HasMaxLength(50).IsRequired();
            Property(p => p.AddressLine2).HasMaxLength(50).IsOptional();
            Property(p => p.City).HasMaxLength(50).IsRequired();
            Property(p => p.State).HasMaxLength(2).IsFixedLength().IsRequired();
            Property(p => p.ZipCode).HasMaxLength(10).IsRequired();
            Property(p => p.CardType).IsRequired();
            Property(p => p.CardNumber).HasMaxLength(20).IsRequired();
            Property(p => p.CardExpirationMonth).IsRequired();
            Property(p => p.CardExpirationYear).IsRequired();
        }
    }
}
